import java.awt.*;

public class TestFrame {
    public static void main(String[] args) {
        //展示多个窗口  new
        MyFame myFame1 = new MyFame(100,100,200,200,Color.blue);
        MyFame myFame2 = new MyFame(300,300,200,200,Color.GRAY);
    }
}
class  MyFame extends Frame{
    static int id =  0;//存在多个窗口，定义一个id进行计数
    public MyFame(int x,int y,int w,int h,Color color){
        super("MyFrame"+(++id));
        setBackground(color);
        setBounds(x,y,w,h);
        setVisible(true);
    }
}